home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / scheme / pseudo-s / pseudo_2.lha / README < prev    next >
Encoding:
Text File  |  1992-02-17  |  7.5 KB  |  206 lines

  1. -*- Mode: Text; -*-
  2.  
  3. File README / Copyright (c) 1991, 1992 Jonathan Rees / See file COPYING
  4. 17 February 1992
  5.  
  6. This is Pseudoscheme, developed by Jonathan Rees at the MIT AI Lab and
  7. the Cornell Robotics and Vision Laboratory (jar@cs.cornell.edu).
  8.  
  9. Send mail to info-clscheme-request@mc.lcs.mit.edu to be put on a
  10. mailing list for announcements.
  11.  
  12. Version 2.8a adds no significant functionality to verion 2.8; it
  13. only has a few bug fixes.  See the end of this file for differences
  14. between version 2.7 and version 2.8.
  15. ----------
  16.  
  17. Here is some documentation.
  18.  
  19.  
  20. INSTALLATION.
  21.  
  22. This version (version 2.8) of Pseudoscheme was developed using Sun
  23. (Lucid) Common Lisp.  Earlier versions of Pseudoscheme have been
  24. tested in Symbolics CL, VAX LISP under VMS, Explorer CL, and a few
  25. other Common Lisps.  If you're installing Pseudoscheme in some other
  26. version of Common Lisp, you may have to customize a few things:
  27.   - edit the definitions of SOURCE-FILE-TYPE and OBJECT-FILE-TYPE
  28.     in "clever.lisp" as appropriate;
  29.   - edit the definition of PREFERRED-CASE in "loadit.lisp" as appropriate
  30.     for your file system;
  31.   - rename file "clever.lisp" if necessary so that your Common Lisp's LOAD
  32.     can find it given just the name "clever".
  33. Please send your customizations to jar@cs.cornell.edu so that they
  34. can be distributed to other users.
  35.  
  36.  
  37. RUNNING PSEUDOSCHEME.
  38.  
  39. To load Pseudoscheme into a Common Lisp system, first load the file
  40. "loadit.lisp", then do
  41.  
  42.     (schi:loadit "<dir>")
  43.  
  44. where <dir> is the directory in which Pseudoscheme is located.  Under
  45. Unix, <dir> should include a final /, e.g. "/u/gjs/pseudo/".  The
  46. first time the system is loaded, it will compile itself.
  47.  
  48. Once the system is loaded, enter Scheme with
  49.  
  50.     (schi:scheme)
  51.  
  52. and leave Scheme with
  53.  
  54.     (quit)
  55.  
  56. There are definitions for everything that's in the Revised^4 Report on
  57. the Algorithmic Language Scheme, although some definitions are
  58. incomplete or approximate.  See under "limitations," below.
  59.  
  60. If you are using a Symbolics system, the first line of every Scheme source
  61. file should be the following:
  62.  
  63.     ;-*- Mode: Scheme; Syntax: Scheme; Package: Scheme; -*-
  64.  
  65.  
  66. EXTENSIONS.
  67.  
  68. The following nonstandard procedures are defined:
  69.  
  70.     quit              - leaves Scheme.
  71.     compile-file      - compiles a file of Scheme code.  Arguments are as
  72.             in Common Lisp's compile-file function.
  73.     compile           - compiles one procedure, like Common Lisp's
  74.             compile function.
  75.     translate-file    - translates a file of Scheme code into Common Lisp.
  76.             Output is written to a file with type ".pso"
  77.             ("Pseudoscheme output").
  78.     pp                - prints something with
  79.               (let ((lisp:*print-pretty* t)) ...). 
  80.     error             - signals an error.  Compatible with T, MIT Scheme,
  81.                 and Common Lisp.
  82.     benchmark-mode    - cause Revised^4 Scheme primitives to be
  83.             inlined.  Analogous to (declare (usual-integrations))
  84.             in MIT Scheme.
  85.  
  86. If you need an EVAL procedure, try this:
  87.  
  88.     (define eval #'schi:scheme-eval)
  89.     (define scheme-user-environment schi:scheme-user-environment)
  90.     (eval '((lambda (x) (+ x 2)) 1)
  91.       scheme-user-environment)    =>  3
  92.  
  93. There are other useful features internally, notably a record package
  94. and a rudimentary module system.  These are currently undocumented.
  95.  
  96. To (mostly) get compatibility with the Scheme dialect used in the book
  97. Structure and Interpretation of Computer Programs, load file sicp.scm.
  98.  
  99.  
  100. LIMITATIONS.
  101.  
  102. Tail recursion will work for ordinary loops written using LETREC,
  103. internal DEFINE, and named LET; in other cases, however, you will have
  104. true tail recursion only if the underlying Common Lisp supports it.
  105.  
  106. CALL-WITH-CURRENT-CONTINUATION is implemented using Common Lisp BLOCK
  107. and is therefore not as general as in a true Scheme.
  108.  
  109. Arithmetic is Common Lisp's, not Scheme's, so the exact/inexact
  110. distinction isn't implemented quite right.
  111.  
  112. Identifiers beginning with & may produce warnings or not work when
  113. running under some Common Lisp implementations.  E.g. Lucid will say
  114. "Error: (&FOO) is an ill-formed lambda-list" for (lambda (&foo) &foo).
  115.  
  116. The Common Lisp reader rejects the identifier "...".  In SYNTAX-RULES,
  117. use "---" instead.
  118.  
  119. Certain Common Lisp implementations implement some instances of the
  120. Lisp FUNCTION type as conses; in this case, the PAIR? procedure may
  121. return #T for some procedures.
  122.  
  123. The WRITE procedure will generate incorrect output for structures
  124. containing #T, #F, and ().
  125.  
  126.  
  127. INTERACTION BETWEEN SCHEME AND COMMON LISP.
  128.  
  129. You can generally call Common Lisp functions from Scheme programs by
  130. using package prefixes, e.g.
  131.  
  132.     (define (openit)
  133.       (lisp:open "foo.txt" :direction :output))
  134.  
  135. Most data types correspond closely: Scheme pairs are Lisp conses,
  136. procedures are functions, ports are streams, etc.  The main difference
  137. is that Scheme boolean false (#F) is different from Lisp boolean false
  138. (NIL).  You should therefore beware of any use of booleans in calls
  139. out to Common Lisp.  The functions SCHI:TRUE? and SCHI:TRUEP can be
  140. used to handle coercions between the two: SCHI:TRUE? turns LISP:NIL
  141. into #F, and SCHI:TRUEP turns #F into LISP:NIL.
  142.  
  143. Common Lisp special forms and macros may or may not work in Scheme
  144. code, because of transformations performed by the translator.  Usually
  145. a special form works if it has the syntax of a function call (as do
  146. e.g. LISP:UNWIND-PROTECT and LISP:CATCH).  If you need to know, you
  147. can see what the translator does by doing (LISP:MACROEXPAND
  148. '<scheme-expression>).
  149.  
  150. You can do Common Lisp special binding from Scheme code using LET or
  151. LAMBDA if the variable is not in the SCHEME package and is proclaimed
  152. special, e.g.
  153.  
  154.     (let ((lisp:*print-level* 10)) ...)
  155.  
  156. While Scheme is running, *PACKAGE* is ordinarily bound to the SCHEME
  157. package.
  158.  
  159.  
  160. REBUILDING THE TRANSLATOR.
  161.  
  162. To rebuild the translator (.pso files) from sources (the .scm files),
  163. follow the directions at the top of file bootit.scm.
  164.  
  165.  
  166. NEW IN VERSION 2.8.
  167.  
  168. - #f and () are distinct values, and () is not treated as false for
  169.   the purpose of conditionals (IF, COND, NOT, etc.).  Among other
  170.   things, this means that (null? #f) and (not '()) are now #f instead
  171.   of #t.
  172.  
  173. - The dialect supported is Revised^4 Scheme, not Revised^3 Scheme.
  174.   This means that a few things have gone away (T, NIL, LAST-PAIR), a
  175.   few things have changed (arguments to NUMBER->STRING and
  176.   STRING->NUMBER), and there are a few new features (PEEK-CHAR,
  177.   LIST?).
  178.  
  179. - As required by the Scheme report, the built-in Scheme procedures are
  180.   not integrated by default.  This means that you can SET! or DEFINE
  181.   any name (except for the syntactic keywords).  It also means,
  182.   however, that programs will run more slowly than they would have
  183.   under version 2.7.  To obtain better performance at the expense of
  184.   the ability to redefine built-ins, evaluate (benchmark-mode).
  185.  
  186. - define-syntax and syntax-rules are implemented, as described in the
  187.   Revised^4 Scheme report.  Unfortunately, there's no way to represent
  188.   the "..." token; for this reason, --- is provided as an alternative.
  189.  
  190. - RATIONALIZE now works as per the Revised^4 Report, except that the
  191.   result is always exact.
  192.  
  193. Bug fixes & minor improvements in version 2.8a:
  194.  
  195. - LETREC strategy analysis fixed for OR, AND, CASE, COND
  196.   [ (do ((i 0 (+ i 1))) ((> i 10)))  was compiling as a LABELS instead
  197.     of as a PROG]
  198. - LIST? fixed  [(list? '(a b)) was returning false]
  199. - In Lucid, warnings about missing IN-PACKAGE's are now muzzled.
  200.   This is a fragile fix; may break in later Lucid versions.
  201.  
  202. - Record print function inconsequentially improved
  203. - ERROR liberalized; first arg can be a Common Lisp condition type name.
  204. - WRITE applied directly to 'FOO prints 'FOO instead of (QUOTE FOO)
  205. - New procedures GET and PUT in sicp.scm
  206.